import { configureStore } from '@reduxjs/toolkit';
import counterReducer from './slices/counterSlice';

// 配置Redux Store
export const store = configureStore({
  reducer: {
    counter: counterReducer,
    // 可以添加更多的reducer
  },
  // 始终启用Redux DevTools
  devTools: true,
});

// 导出RootState和AppDispatch类型，用于TypeScript类型推断
export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;